package com.springboot.mybatis.service.Impl;

import com.springboot.mybatis.entity.UserMyBatis;
import com.springboot.mybatis.mapper.UserMybatisMapper;
import com.springboot.mybatis.service.UserMybatisService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class UserMybatisServiceImpl implements UserMybatisService {
    @Resource
    private UserMybatisMapper userMybatisMapper;

    @Transactional
    @Override
    public void addTwo() {
        userMybatisMapper.insert(new UserMyBatis(null,"张三",18));
        userMybatisMapper.insert(new UserMyBatis(null,"张三",19));
    }
}
